package Model;

import java.util.ArrayList;

public class ForestCollection {

    //Properties
    private ArrayList<Forest> forestList;
    private static ForestCollection instance;

    //Constructor
    public ForestCollection(){
        forestList = new ArrayList<Forest>();
    }

    //Singleton
    public static ForestCollection getInstance(){
        if(instance == null){
            instance = new ForestCollection();
        }

        return instance;
    }

    //Add a forest
    public void addForest(Forest f){
        //Test!!!
        forestList.add(f);
    }

    //Find a forest
    public Forest findForest(String name){

        for (Forest f : forestList){
            if(f.getForestName() == name) {
                return f;
            }
        }
        return null;
    }
}
